OtpFieldDefaults

Default styles for OtpField. From Swift, call for example OtpFieldDefaults.shared.style(); Kotlin default arguments are not visible to Swift, so the zero-argument functions return the defaults.

Functions

Link copied to clipboard

Dynamic system colors that adapt to dark mode and Increase Contrast.

fun colors(text: UIColor = UIColor.labelColor(), cellBackground: UIColor = UIColor.systemBackgroundColor(), cellBorder: UIColor = UIColor.systemGrayColor(), focusedCellBorder: UIColor = UIColor.labelColor(), errorCellBorder: UIColor = errorColor(), errorText: UIColor = errorColor(), disabledText: UIColor = UIColor.tertiaryLabelColor(), disabledCellBackground: UIColor = UIColor.systemGray6Color(), disabledCellBorder: UIColor = UIColor.systemGray3Color(), placeholder: UIColor = UIColor.systemGrayColor()): OtpFieldColors
Link copied to clipboard

Style with all defaults.

fun style(font: UIFont = UIFont.monospacedSystemFontOfSize(28.0, weight = UIFontWeightSemibold), fontTextStyle: UIFontTextStyle = UIFontTextStyleTitle1, errorTextStyle: UIFontTextStyle = UIFontTextStyleCallout, cornerRadius: Double = 8.0, minCellWidth: Double = 48.0, minCellHeight: Double = 56.0, cellSpacing: Double = 8.0, borderWidth: Double = 1.0, focusedBorderWidth: Double = 2.0, colors: OtpFieldColors = colors(), groupSize: Int = 0, placeholder: String? = null): OtpFieldStyle